<%@include file="startUpIncludes.jsp" %>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <title>
            Edit Call
        </title>
    </head>
    <body>
    <jsp:include page="header.jsp" >
		<jsp:param value="true" name="loggedIn"/>
	</jsp:include>
    <div class="wrap">
	<div class="fitBG">
        <div class="main">
		<%@include file="basicLeftMenu.jsp" %>
            <div class="content">
				<jsp:include page="tabs.jsp" >
					<jsp:param value="leads" name="currentPage"/>
				</jsp:include>
                <div class="tab-content">
                <h3>Edit Call</h3>
                <span class="numberError error-block">Please enter a valid number.</span>
                <form:form class="new-lead-form" method="post" action="/sales/s/edit-call" id="newCallForm" commandName="callForm">
				<form:errors class="error-block"  path="*"/>
                <div class="btns">
                <input type="submit" onclick="formvalidation(this);" value="Save" class="form-btn"/><a  href="/sales/s/leads" class="form-btn">Cancel</a>
                </div>
                <div class="form-row">
                <input type="hidden" name="id" value="${id}"/>
                <input type="hidden" name="parentId" value="${parentId}"/>
                <input type="hidden" name="parentType" value="${parentType}"/>
                    <h4>Call Information</h4>
                    <div class="info"><label>Call Owner: </label><span>${userDetails.fName} ${userDetails.lName}</span></div>
                    <div class="info"><label>Lead Name: </label><span>${lead.fName}</span></div>
                    <div class="info"><label>Lead Company: </label><span>${lead.companyName}</span></div>
                    <div class="input-col">
                    
                        <label>CRM Staff: </label>
                        <select  class="TB" name="crmStaff">
	                        <c:forEach items="${crmStaff}" var="staff">
		                        <c:choose>
		                        	<c:when test="${callForm.crmStaff == staff.id}">
		                        		<option value="${staff.id}" selected="selected">${staff.fName} ${staff.lName}</option>
		                        	</c:when>
		                        	<c:otherwise>
		                        	<option value="${staff.id}">${staff.fName} ${staff.lName}</option>
		                        	</c:otherwise>
		                        </c:choose>
	                            
	                         </c:forEach>
                        </select>
                       
                        <label>Contacted Person    *: </label>
                        <select  class="TB" name="contactedPerson">
                        <c:forEach items="${contacts}" var="contact">
                        <c:choose>
                        	<c:when test="${callForm.contactedPerson eq contact.id}">
                        		<option value="${contact.id}" selected="selected">${contact.fName}</option>
                        	</c:when>
                        	<c:otherwise>
                        		<option value="${contact.id}">${contact.fName}</option>
                        	</c:otherwise>
                        </c:choose>
                            
                         </c:forEach>
                        </select>
                        <label>Date       *: </label>
                         <jsp:include page="calendar-jquery.jsp" >
							<jsp:param value="datepicker" name="inputDateId" />
						</jsp:include>
                        <form:input id="datepicker" class="TB" name="date" path="date"/>
						<label>Stating Time    *: </label>
                        <jsp:include page="time-jquery.jsp" >
							<jsp:param value="time" name="inputTimeId"/>
						</jsp:include>
                        <input type="text" class="TB" name="startTime" id="time" value="${callForm.startTime}"/>
                        <label>Ending Time     *: </label>
                         <jsp:include page="time-jquery.jsp" >
							<jsp:param value="endtime" name="inputTimeId"/>
						</jsp:include>
                        <input type="text" class="TB" name="endTime" id="endtime" value="${callForm.endTime}"/>
                    </div>
                    <div class="input-col">
                        <label>In/Out Call: </label>
                        <c:choose>
                        	<c:when test="${callForm.inOutCall == true}">
				                <input type="radio" class="RdCh" name="inOutCall" value="true" checked="checked"/><span class="RdCh">In</span>
		                        <input type="radio" class="RdCh" name="inOutCall" value="false"/><span class="RdCh">Out</span>
                        	</c:when>
                        	<c:when test="${callForm.inOutCall == false}">
                        		<input type="radio" class="RdCh" name="inOutCall" value="true" /><span class="RdCh">In</span>
		                        <input type="radio" class="RdCh" name="inOutCall" value="false" checked="checked"/><span class="RdCh">Out</span>
                        	</c:when>
                        	<c:otherwise>
	                        	<input type="radio" class="RdCh" name="inOutCall" value="true" /><span class="RdCh">In</span>
		                        <input type="radio" class="RdCh" name="inOutCall" value="false"/><span class="RdCh">Out</span>
                        	</c:otherwise>
                        </c:choose>
                        
                        <label>Decision Maker      *: </label>
                        <c:choose>
                        	<c:when test="${callForm.decisionMaker == true}">
		                        <input type="radio" class="RdCh" name="decisionMaker" value="true" checked="checked"/><span class="RdCh">yes</span>
		                        <input type="radio" class="RdCh" name="decisionMaker" value="false"/><span class="RdCh">No</span>
                        	</c:when>
                        	<c:when test="${callForm.decisionMaker == false}">
		                       <input type="radio" class="RdCh" name="decisionMaker" value="true"/><span class="RdCh">yes</span>
	                        	<input type="radio" class="RdCh" name="decisionMaker" value="false" checked="checked"/><span class="RdCh">No</span>
                        	</c:when>
                        	<c:otherwise>
	                        	<input type="radio" class="RdCh" name="decisionMaker" value="true"/><span class="RdCh">yes</span>
	                        	<input type="radio" class="RdCh" name="decisionMaker" value="false"/><span class="RdCh">No</span>
                        	</c:otherwise>
                        </c:choose>
                        
                        <label>Comment: </label>
                        <textarea class="TB" name="comment" placeholder="Enter your comment on the call">${callForm.comment}  </textarea>
                    </div>
                </div>   
                <div class="form-row">
                    <h4>Next Follow Up Information</h4>
                    <div class="input-col">
                        <label>Next Follow Up: </label>
                        <c:choose>
                        	<c:when test="${callForm.nextFollowUp == true}">
		                        <input type="radio" class="RdCh" name="nextFollowUp" value="true" checked="checked"/><span class="RdCh">yes</span>
		                        <input type="radio" class="RdCh" name="nextFollowUp" value="false"/><span class="RdCh">No</span>
                        	</c:when>
                        	<c:when test="${callForm.nextFollowUp == false}">
		                       <input type="radio" class="RdCh" name="nextFollowUp" value="true"/><span class="RdCh">yes</span>
	                        	<input type="radio" class="RdCh" name="nextFollowUp" value="false" checked="checked"/><span class="RdCh">No</span>
                        	</c:when>
                        	<c:otherwise>
	                        	<input type="radio" class="RdCh" name="nextFollowUp" value="true"/><span class="RdCh">yes</span>
	                        	<input type="radio" class="RdCh" name="nextFollowUp" value="false"/><span class="RdCh">No</span>
                        	</c:otherwise>
                        </c:choose>
                        <label>Next Follow Up Type: </label>
                        <select class="TB" name="nextFollowUpType">
                        	<option value="none" <c:if test="${callForm.nextFollowUpType eq 'none'}">selected</c:if>>--none--</option>
	                        <option value="call" <c:if test="${callForm.nextFollowUpType eq \"call\"}">selected</c:if>>Call</option>
	                        <option value="appointment" <c:if test="${callForm.nextFollowUpType eq \"appointment\"}">selected</c:if>>Appointment</option>
                        </select>
                    </div>
                    <div class="input-col">
                        <label>Next Follow Up Date: </label>
                        <jsp:include page="calendar-jquery.jsp" >
							<jsp:param value="datepicker2" name="inputDateId"/>
						</jsp:include>
                        <input type="text" id="datepicker2" class="TB" name="nextFollowUpDate" value="${callForm.nextFollowUpDate}"/>
                        <label>Next Follow Up Details: </label>
                        <input type="text" class="TB" name="nextFollowUpDetails" value="${callForm.nextFollowUpDetails}"/>
                    </div>
                </div>
                <div class="btns">
                <input type="submit" value="Save" class="form-btn"/><a href="/sales/s/leads" class="form-btn">Cancel</a>
                </div>
                </form:form>
                </div>
            </div>
        </div>
        
    <%@include file="footer.jspf" %>
    </div>
    </div>

    </body>
</html>